<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title>用户管理</title>
	<%@ include file="layouts/top.jsp"%>
	
	<script type="text/javascript" charset="UTF-8" src="${ctx}/js/ajaxfileupload.js"/></script>
	<script type="text/javascript" charset="UTF-8" src="${ctx}/js/users/Init.js"/></script>
	<script type="text/javascript" charset="UTF-8" src="${ctx}/js/users/Event.js"/></script>
	<script type="text/javascript" charset="UTF-8" src="${ctx}/js/users/Cmd.js"/></script>
	<script type="text/javascript" charset="UTF-8" src="${ctx}/js/users/Import.js"/></script>
</head>
<body>
	<div id="toolbar" class="search_bar" style="height:auto">
		<table style="width:100%">
			<tbody>
				<tr class="line_0">
					<td class="search_title">用户ID:</td>
					<td class="search_content">
						<input id="userId_query" style="width:150px;" />
					</td>
					<td class="search_title">用户名:</td>
					<td class="search_content">
						<input id="userName_query" style="width:150px;" />
					</td>
				</tr>
				<tr>
					<td class="search_title">所属部门:</td>
					<td class="search_content">
						<select id="job_query" class="easyui-combobox" style="width:150px;"></select>
					</td>
					<td class="search_title">所属网点:</td>
					<td class="search_content">
						<select id="branch_query" class="easyui-combobox" style="width:150px;"></select>
					</td>
					<td class="search_title">是否管理职位:</td>
					<td class="search_content">
						<select id="isManager_query" class="easyui-combobox" style="width:150px;">
							<option value="1">是</option>
							<option value="0">否</option>
						</select>
					</td>
				</tr>
			</tbody>
		</table>
		<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="query()">查询</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="initAdd()">增加</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="importExcel()">导入</a>
	</div>
	<table id="dg" title="查询列表" class="easyui-datagrid" toolbar="#toolbar"
		url="<c:url value="/system/queryUsersList"/>" rownumbers="true"
		fitColumns="true" singleSelect="true" pagination="true">
		<thead>
			<tr>
				<th field="userId" width="30">用户ID</th>
				<th field="userName" width="30">用户名</th>
				<th field="telephone" width="30">联系电话</th>
				<th field="jobName" width="30">所属部门</th>
				<th field="branchName" width="30">所属网点</th>
				<th field="isManager" formatter="formatManager" width="30">是否管理职位</th>
				<th field="registDate" formatter="formatDate" width="30">注册时间</th>
				<th field="action" formatter="formatAction" width="50">操作</th>
			</tr>
		</thead>
	</table>

	<div id="dlg" class="easyui-dialog"
		style="width: 650px; height: auto; padding: 5px 5px;"
		closed="true" buttons="#dlg-buttons">
		<div align="left">
			<table class="formInfoTable" id="infoTable" width="100%">
				<tr>
					<td class="formInfoTable_LableCol">用户ID</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<input id="userId_text" style="width:150px;" />
					</td>
					<td class="formInfoTable_LableCol">用户名</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<input id="userName_text" style="width: 150px;" />
					</td>
				</tr>
				<tr>
					<td class="formInfoTable_LableCol">是否管理职位</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<select id="isManager_text" class="easyui-combobox" style="width:150px;">
							<option value="1">是</option>
							<option value="0">否</option>
						</select>
					</td>
					<td class="formInfoTable_LableCol">联系电话</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<input id="telephone_text" style="width: 150px;" />
					</td>
				</tr>
				<tr>
					<td class="formInfoTable_LableCol">所属部门</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<select id="job_text" class="easyui-combobox" style="width:150px;"></select>
					</td>
					<td class="formInfoTable_LableCol">所属网点</td>
					<td class="formInfoTable_StarCol">*</td>
					<td class="formInfoTable_InfoCol">
						<select id="branch_text" class="easyui-combobox" style="width:150px;"></select>
					</td>
				</tr>
			</table>
		</div>
		<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUser()">保存</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
		</div>
	</div>
	
	<div id="batchDlg" class="easyui-dialog"
		style="width:450px; height:280px; padding:10px 10px; top:50px"
		closed="true" buttons="#batchDlg-buttons">
		<div id="fileDiv">
			选择： <input id="fileToUpload" type="file" size="25"
				name="fileToUpload" onchange="checkType()">
			<button class="button" id="buttonUpload" onclick="uploadBath()">上传</button>
			<br> <input id="filePathId" type="hidden" />
			<div class="msg-info">
				<div class="msg-tip icon-tip"></div>
				<div id="uploadMsg" style="color: #F00;"></div>
			</div>
		</div>
		<br>
		<div id="resultMsg"></div>

		<div style="bottom: 35px; position: absolute;">
			<span style="color: red;">注：</span>
			<ul>
				<li>1、请选择Excel格式文件，点此
					<button onclick="downlodFile()">下载模板</button>
				</li>
				<li>2、新添加用户密码初始化为555</li>
				<li>3、所属部门只能填写已登记的部门名称</li>
				<li>4、所属网点只能填写已登记的网点名称</li>
				<li>5、是否管理岗填写是或否</li>
			</ul>
		</div>
	</div>
	<div id="batchDlg-buttons">
		<a href="#" id="InductionButtons" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveBatch()">导入</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#batchDlg').dialog('close')">取消</a>
	</div>
	<div id="msgDlg" class="easyui-dialog" closed="true" style="width:450px;height:450px;padding:10px 10px;">
		<div id="recordMsg" ></div>
	</div>
	
	<div id="exportDiv" class="easyui-dialog"
		style="width: auto; height: auto; padding: 10px 10px;" closed="true">
		<form id="exportForm" action="">
			<input id="cmdInput" type="hidden" name="cmd" value="" />
			<a id="export" href="#">导出结果..</a>
		</form>
	</div>
</body>
</html>